import {view, ViewGroup, binder} from "adajs";
import ContactsService from "./state.js";

@view({
    className: "contacts",
    template: "./template.html",
    style: "./style.scss",
    dataset: {
        service: ContactsService
    }
})
class Contacts extends ViewGroup {
    @binder("active")
    active({type}) {
        this.commit("active", type);
    }

    @binder("search")
    search() {
        let keyword = this.finder('keyword').getElement().value;
        this.commit("search", keyword);
    }
}

export default Contacts;